package org.jivesoftware.smackx.provider;

import java.text.ParseException;
import java.util.Date;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.provider.PacketExtensionProvider;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.packet.DelayInformation;
import org.xmlpull.v1.XmlPullParser;

public class DelayInformationProvider
  implements PacketExtensionProvider
{
  public PacketExtension parseExtension(XmlPullParser paramXmlPullParser)
    throws Exception
  {
    String str1 = paramXmlPullParser.getAttributeValue("", "stamp");
    Date localDate = null;
    try
    {
      localDate = StringUtils.parseDate(str1);
    }
    catch (ParseException localParseException)
    {
      if (localDate == null)
        localDate = new Date(0L);
    }
    DelayInformation localDelayInformation = new DelayInformation(localDate);
    localDelayInformation.setFrom(paramXmlPullParser.getAttributeValue("", "from"));
    String str2 = paramXmlPullParser.nextText();
    str2 = "".equals(str2) ? null : str2;
    localDelayInformation.setReason(str2);
    return localDelayInformation;
  }
}

/* Location:           D:\hygieia\userclient\common\libs\easemobchat_2.1.8.jar
 * Qualified Name:     org.jivesoftware.smackx.provider.DelayInformationProvider
 * JD-Core Version:    0.6.1
 */